<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateInvoiceResourcesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('invoice_resources', function (Blueprint $table) {
            $table->increments('invoice_resources_id');
            $table->engine = "innodb";
            $table->integer("user_id")->index()->comment("用户id");
            $table->string('money', 30)->default('')->comment("银行账户");
            $table->integer('invoice_type_id')->default(0)->comment("默认为无时间限制");
            $table->string('invoice_type_name', 30)->default('')->comment("报销类型");
            $table->integer('invoice_id')->default(0)->comment("默认为无时间限制");
            $table->string('type', 30)->default('')->comment("报销类别");
            $table->boolean("status")->default(0)->comment("是否使用");
            $table->boolean("is_delete")->default(0)->comment("是否删除");
            $table->timestamp('over_time')->comment("可报销的截止时间");
            $table->timestamp('create_time')->index()->comment("创建时间");
            $table->timestamp('end_time')->index()->comment("截止时间");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('invoice_resources');
    }
}
